import request from '@/utils/request'
import axios from 'axios'

/**
 * 获取所有用户
 */
export const all = (params:any) => request.post('/sys-set/users',params)

export const menu=(data:any)=>request({
  url:'/sys-set/menu',
  method:'get',
  data
})

export const getUserInfo = (data: any) =>
  request({
    url: '/sys-set/uinfo',
    method: 'post',
    data
  })

export const login = (data: any) =>
  request.post('/login', data)

export const logout = () =>
  request({
    url: '/users/logout',
    method: 'post'
  })
/**
 * 通过role ids 获取菜单列表
 * @param data 
 */
  export const role2menuByIds=(data:any)=>request.post("/sys-set/role2menuByIds",data);

  /**
	 * 合并查询，查询出菜单及角色的权限
	 * 
	 * @param data
	 * roleid 角色id
	 * @return TreeNodeList<SysMenu>
	 */
  export const selectByRole2Menu=(data:any)=>request.post('/sys-set/selectByRole2Menu',data);

  /**
   * 保存权限
   * @param data 
   */
  export const saveRole2Menu=(data:any)=>request.post('/sys-set/saveRole2Menu',data);

  /**
   * 获取一个表的编辑属性
   * @param params 
   */
  export const datarow=(params:any)=>request.post('/sys-set/datarow',params);

  /**
   * 
   * @param params 保存编辑
   */
  export const edrow=(params:any)=>request.post('/sys-set/edrow',params);

  /**
   * 
   * @param params 删除数据
   */
  export const destory=(params:any)=>request.post('/sys-set/destory',params);

